package com.firsteapps.mobile.android.puzzle;

import com.firsteapps.mobile.android.puzzle.util.Consts;

public class HighScore implements Comparable<HighScore> {
	private String username;
	private int movesCount;
	private int timePassed;
	private int score;

	public HighScore(String username, int moves, int time, int score) {
		setUsername(username);
		setMovesCount(moves);
		setTimePassed(time);
		setScore(score);
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public int getMovesCount() {
		return movesCount;
	}

	public void setMovesCount(int movesCount) {
		this.movesCount = movesCount;
	}

	public int getTimePassed() {
		return timePassed;
	}

	public void setTimePassed(int timePassed) {
		this.timePassed = timePassed;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	@Override
	public int compareTo(HighScore another) {
		return another.getScore() - this.getScore();
	}

	@Override
	public String toString() {
		return getUsername() + Consts.FILENAME_SPLITTER + getMovesCount() + Consts.FILENAME_SPLITTER + getTimePassed()
				+ Consts.FILENAME_SPLITTER + getScore();
	}
}
